home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
20
/
9
/
DISK2092.ZIP
/
RBBS-UTL.ZIP
/
UTIL
/
MU-PURGE.DOC
< prev
next >
Wrap
Text File
|
1987-05-30
|
25KB
|
925 lines
MU-PURGE v3.0
for the RBBS-PC message system
v CPC12-3B & up
(C) Copyright 1985, 86, 87
Kim E. Wells
1206 Pickering Circle
Upper Marlboro, MD, 20772
D:301-350-1299 V:301-350-4570
SEAdog / FidoNet 109/652
1
-- RBBS Compatibility --
This program has been tested with all versions of the RBBS-PC
conference and user files from CPC12.3B to CPC15.1A
-- Introduction --
MU-PURGE.EXE in conjunction with its .DOC file is a program to purge
the RBBS-PC conference and user type files of killed msgs and old or
inactive users independently of CONFIG.EXE. In doing so, MU-PURGE
simplifies system maintenance since it can be used as a free standing
program or executed via a batch file.
It was originally conceived to solve two different problems:
1. To fix a message file which contained blank records for Dave
William's Amateur Radio RBBS in Billings Montana(406-656-8124)
2. To be able to have the message file on my RBBS purged while I was
out of town for several days at a time.
Prior to the release of RBBS Version CPC 12-3A, message file purging
code was contained in RBBS-PC.EXE, then removed and placed into CONFIG.EXE.
Since CONFIG.EXE can not be executed via modem, remote sysops can not purge
the message file as they once could when the code was included in RBBS-PC.
MU-PURGE has been in use on my 24 hour, 60 call a day RBBS and
executed from an "EBL" (Extended Batch Language) batch file since it was
first written in early May 1985.
-- Implementation --
MU-PURGE can be used as a free standing program to purge the message
and user files or it can used in a DOS or EBL batch file. Execution via
either method is the same. On the command line you supply the name MU-
PURGE and the name of the message or user file you want purged.If necessary
you may need to supply the drive and the file extension if appropriate.
You must supply a valid filespec in order for MU-PURGE to work. This
program is so written not to make any assumptions.
To execute MU-PURGE.EXE one need only specify the following at the DOS
Prompt:
For Message files:
A:MU-PURGE MESSAGES /MSG: or
A:MU-PURGE E:Messages /MSG: or
A:MU-PURGE E:CHESSM.DEF /MSG:
2
For User files:
A:MU-PURGE USERS /USR: or
A:MU-PURGE E:USERS /USR: or
A:MU-PURGE E:CHESSU.DEF /USR:
For CONTROL-FILES:
A:MU-PURGE C:\RBBS\DAILY.CTL
Earlier versions of this program required you to have at least the
same amount of free space on the disk as the size of the message or user
file you are purging. Not so with this version. Several new options have
been and are implemented with a command line switch. The most significant
option is the ability to "PACK IN PLACE" (PIP) any message or user type
file. This feature simply shuffles active message records towards the
beginning of the file by overwriting previously killed messages. In the
case of a user file, deleted users records are overwritten with a blank
record. Using this method to purge the message file does not leave you
with a backup file.
Immediately after the first backslash on the commandline, MSG: or USR:
must be specified. This tells MU-PURGE what type of file it is.
A complete list of the optional parameters for msg files is as
follows;
Commands to be placed in Switch 1;
D### Purge Msgs over ### days old
IN Initialize Node Records
K Kill (delete) the back-up file .OLD
LOG Log program operations to MU-PURGE.LOG
NO No, don't default to PIP
PIP Pack-In-Place the FILESPEC file
REMOTE Send screen output to current DOS console
Commands to be placed in Switch 2;
EF$....$ Exclude from purging a File of To: / From: name(s)
EF#....# Exclude from purging a File of Mgs Numbers
EL$....$ Exclude from purging a To: / From: name(s) listed on
the commandline
EL#....# Exclude from purging a Msg number listed on the
commandline
CHR$(#) Character in subject field that signifies exclusion
Commands to be placed in Switch 3;
NF(....) Compare NAME FROM in a msg to a selected user file
NT " Compare NAME TO in a msg to a selected user file
O " Check to see if this message has been read by the
receiver
3
A complete list of the optional parameters for user files is as
follows;
Commands in Switch 1;
D### Purge Inactive Users over ### days old
K Kill (delete) the back-up file .OLD
LOG Log program operations to MU-PURGE.LOG
NO No, don't default to PIP
PIP Pack-In-Place the FILESPEC file
REMOTE Same as above.
Commands in Switch 2;
### Minimum Logon Security level
Same as CONFIG.EXE parameter #101
Commands in Switch 3;
### Security Level Exempt From Purging
Same as CONFIG.EXE parameter #117
(msg file spec) A compatible message file checkpoint record can be
updated to reflect the current number of users in a user file
Explanation of available commands
D### Purge Msgs over ### days old"
K Kill (delete) the back-up file .OLD
Then purging the selected message file in a NON-PIP mode a backup
message file is created. You can kill that file with this command.
IN Initialize Node Records"
Adding the letters "IN" to the first commandline switch
willreinitialize all of the NODE records in the message file. This feature
was added to help those SYSOP's who have had trouble with RBBS doing
strange things when the node records have been corrupted.
This feature will save them the trouble of having to make a new
message file or attempt to correct the problem manually.
NO No, don't default to PIP
If the PIP mode of purging wasn't selected, MU-PURGE will check to see
if enough free disk space is available to purge by creating a new message
file. If enough free disk disk space isn't available the program will
terminate if NO was specified or it will default back to purging via the
PIP mode.
4
PIP Pack-In-Place the FILESPEC file
Pack-In-Place is purging by rewriting Active Msgs over Killed Msgs.
This method is rather fast in that MU-PURGE scans the message file looking
for the first killed msg and THEN starts rewriting over the killed
messages.
REMOTE Send screen output to current DOS console
IBM BASIC sends its' screen output directly to screen memory. By
specifying on the command REMOTE all output that would normally be written
to the users local screen will now be written to the current DOS console.
While MU-PURGE could have been executed after using RBBS SYSOP function 7,
now they'll be able to see what's happening also.
Dots represent user supplied information
EF$.............$ EXCLUDE a file of NAMES
EF#.............# EXCLUDE a file of NUMBERS
Between the two dollar and or number signs, you can provide the
filespec of an ASCII file that contains names or msgs numbers that are to
be excluded from purging. A separate file must be used for numbers and
names.
EL$.............$
EL#.............#
Similarly you and do the same thing on the commandline with names or
numbers. A semicolon is used as a delimiter. When using the D###
function to delete msgs that where over ### days old, a way was needed to
retain certain msgs. By adding an "EL# or EL$" to the commandline switch
you can exclude certain messages from purging by either specifying a msg
number(s) or a name(s) as used in the TO / FROM block or you specify both
ways. Implementation of this function is a little tricky. Study the
examples in APPENDIX B. When using the same exclusion commands in a
control file, those commands aren't reloaded. That is, if the first
message file your purged read a file of names to exclude and the next
message file is to use the same file of names, that file has been loaded
once and won't be reread.
CHR$(#) Character Exclusion
Exclude from purging a To: / From: name(s) listed on the commandline
or in a file, IF AND ONLY IF the characters "" CHR$(#) "" with some number
of an ASCII character between the parans, are located in SWITCH2 and that
equates to the ASCII value of the first character in the subject field.
NF(....) Compare NAME FROM in a msg to a selected user file
Message will be purged if the sender isn't in the selected USER file. A
msg on the screen will display that the msg was purged, why it was purged
(RNR ... Receiver Not Registered) and the intended receivers name.
5
NT " Compare NAME TO in a msg to a selected user file
Message will be purged if the receiver isn't in the selected USER file. A
msg on the screen will display that the msg was purged, why it was purged
(SNR ... Sender Not Registered) and the senders name.
O " Check to see if this message has been read by the
receiver. Message will be purged if and only if the receiver has read the
message and it is protected. A msg on the screen will display that the msg
was purged, why it was purged, (RRM ... Receiver Read Mail) and the
receivers name and high msg read.
When purging messages that are compared to a users file, the user
should beware that the SYSOP's real name is rarely, if ever, entered in the
users files. Therefore, the SYSOP's real name should always be excluded
from an automatic purge operation. The statistics that are displayed at
the programs end show active and purged messages as well as used and unused
message records. The numbers that are displayed may be different then what
RBBS reports due to RBBS considering node records as message records. A
similar situation will appear when purging a USERS file. MU-PURGE shows
the totals of active, exempt, and locked-out users which when combined will
total what RBBS calls the current amount of active users.
Appropriate error messages are generated for abnormal conditions.
-- Control files --
MU-PURGE can read a list of user and message files that are to be
purged from a ASCII file that properly contains a list of those files and
all the required parameters. All entries in that file are similar in
structure to those that can be entered on a DOS commandline. A CONTROL-
FILE must have a file name extension of ".CTL". It must not contain any
blank lines.
SEE APPENDIX B for command parameter examples.
MU-PURGE can be used in a normal DOS batch file, but since DOS batch
files can't count, an additional program is required to count the number of
times the batch file has been executed. See appendix A for a sample batch
file and program to count execution times. "EBL" batch files run much
faster than DOS Batch files. The advantage to using "EBL" over DOS batch
files is not only speed of execution but you no longer need a separate to
count the number of times the file has executed. That ability and many
others are included with "EBL".
It should be noted that familiarity with "EBL" is essential in order
to correctly drive your RBBS with this type of batch file and "EBL" only
works with PC-DOS and the IBM Personal Computer or true compatiables. See
appendix A for a sample EBL batch file.
6
-- Program Limitations: --
1. ALL the limitations that accompany the use of the Microsoft
QuickBASIC compiler version 3.0
2. MU-PURGE is not medicine to fix a message file that for some
reason is in an ill state of format. It is requested that you send me a
copy of your bad message file on diskette or via upload to my bbs so that I
can include code in future releases of this program, to fix similar
problems.
-- Future Releases --
Future Releases are at irregular intervals as the need arises. You
can always get the latest version from my RBBS. (301-350-1299)
-- Programming and Compilation --
MU-PURGE was compiled using the Microsoft QuickBASIC Compiler v3.0.
Several ASM routines from ADVBAS.LIB by Thomas Hanlin and
Super BASIC LIB by Marilyn Fleming were used to overcome limitations
of BASIC.
-- Limited License --
This software is copyrighted but a limited license is granted and you
are free to use and share it under the following conditions:
1. MU-PURGE v3.0 is not distributed in modified form,
2. No fee or other consideration is charged for MU-PURGE itself, and
3. Reference to the copyright and author is retained.
4. Use of this program to maintain a subscription BBS is prohibited
without the express permission of the author.
7
-- Warranty --
MU-PURGE is provided "AS IS" without warranty of any kind, either
expressed or implied, including, but not limited to the implied warranties
of merchantability and fitness for a particular purpose. The entire risk
as to the quality and performance of this program is with the user and
should the program prove defective, the user and not the author will assume
the entire cost of all necessary remedies. The author does not warrant
that the functions contained in the program will meet any users
requirements or that the operation of the program will be uninterrupted or
error free.
8
-- Acknowledgements --
RBBS-PC (C)
D. Thomas Mack
Address Below
ADVBAS (C)
Thomas Hanlin
Address Below
EXTENDED BAT LANGUAGE (BAT) (C)
Frank Canova
Seaware Corp P.O. Box 1656 Delray Beach, Florida 33444
305-276-5072
IBM
International Business Machines Inc.
P.O. Box 1328-S Boca Raton, Florida 33432
QuickBASIC (C)
Microsoft Corp
16011 NE 36th Way Box 97017 Redmond, WA. 98073-9717
SuperBASIC (C)
Fleming Software PO Box 528 Oakton, Va. 22124
"Special Thanks" for their ideas and assistance in the preparation and
testing of this program and its' documentation to:
Roger Fajman 21 Bannister Court, Gaithersburg, Md, 20879
Phil Grier 3375 Sudlerville South, Laurel, Md, 20707
Thomas Hanlin III 6812 Syndenstricken Rd, Springfield, VA. 22152
Tom Mack 10210 Oxfordshire Road, Great Falls, Virginia 22066
Data: 703-759-5049 & 703-759-9659
Tanya Metaska 6112 Thomas Drive, Springfield, Va, 22150
Data: 703-971-4491
Richard Moreland 345 Raven Wing Drive, Porter, Texas, 77365
William Silva 14103 Dub Drive, Laurel, Maryland. 20708
Lori Wells 1206 Pickering Circle, Upper Marlboro, Md. 20772
Dave Williams 11 Gatewood Drive, Billings, Mt, 59102
9
-- APPENDIX A -- Batch File Information
*** In order for MU-PURGE to be executed from a batch file, Parameter
#123 in the RBBS-PC Configuration Program "CONFIG.EXE" must have been
previously set to "SYSTEM" recycle.
Sample DOS Batch file drive RBBS with MU-PURGE
(code for WATCHDOG.COM included)
IF NOT EXIST A:RCTTY.BAT GOTO LOCAL
A:WATCHDG1 OFF
DEL A:RCTTY.BAT
:LOCAL
IF EXIST BATCH.CTL GOTO SYSTEM
A:MU-PURGE MESSAGES
:SYSTEM
A:BASICA COUNTER ( *** or COUNTER.EXE *** )
A:RBBS-PC
IF EXIST A:RCTTY.BAT GOTO REMOTE
A:RBBS.BAT
:REMOTE
A:WATCHDG1 ON
A:RCTTY.BAT
Sample BASIC Program to count the passes thru a DOS batch file.
1 ON ERROR GOTO 13
2 OPEN "BATCH.CTL" AS 2
3 NAME "COUNTER.DAT AS "KIM" :NAME "KIM" AS "COUNTER.DAT"
5 OPEN "COUNTER.DAT" AS 1 LEN = 4
6 FIELD 1,2 AS C1$, 2 AS C2$
7 C1 = VAL(C1$) :C2$ = VAL(C2$)
8 IF C1 >= C2 THEN CLOSE 2 :KILL "BATCH.CTL"
9 C1 = C1 + 1
10 RSET C1$ = STR(C1) :PUT 1,1
12 SYSTEM
13 IF ERR = 53 AND ERL = 3 THEN OPEN "COUNTER.DAT" AS 1
14 FIELD 1, 2 AS C1$, 2 AS C2$
15 RESET C1$ = "0" :RESET C2$ = "3" :PUT 1,1
17 RESUME 7
10
Sample EXTENDED LANGUAGE BATCH FILE
BAT
bat %I = 0
bat -start.over
bat stateof A:RCCTY.BAT | if %r = 0 call -sub.local
RBBS-PC
BAT
bat stateof A:RCTTY.BAT | if %r = 0 goto -sub.remote
bat %I = %I + 1| if %I =20 call -sub.purge
bat goto -start.over
bat -sub.purge
MU-PURGE MESSAGES /K
MU-PURGE CHESSM.DEF /K
BAT
bat %I = 0 | return
bat sub-local
WATCHDG1 OFF
Del RCTTY.BAT
BAT
bat return
bat -sub.remote
WATCHDG1 ON
RCTTY
11
-- APPENDIX B -- Command Examples
The general command structure is as follows;
At the DOS prompt type:
MU-PURGE message.filespec /MSG: [option(s)/option(s)/option(s)]"
where the message.filespec is
[drive:] [path] filename [.filename extension]
At the DOS prompt type ......
A>MU-PURGE C:MESSAGES /MSG:PIPD45 /EL#1111;2222;3333;4444#
The above command will call MU-PURGE from the default drive A:, purge
the message file called MESSAGES on the C: drive, invoke a PACK in PLACE
mode of operation, purge all messages over 45 days old and exclude from
purging messages 1111, 2222, 3333, 4444 unless anyone of them had been
previously killed in RBBS.
The syntax for msg pruging exclusion requires that the message
number(s) must be enclosed with the number sign (#) and the entire list of
number(s) must be prefaced with an "EL". Additionally the same applies for
a list of name(s) which must be enclosed with a dollar sign ($). To
implement both functions simply list both on the commandline.
A>MU-PURGE C:MSGS /MSG:PIPD45 /EL#1111#EL$Kim Wells;Dave Willaims$
The above command will do all of the previous example and exclude from
purging the names Kim Wells and Dave Willaims. MU-PURGE will convert any
lower case to UPPER CASE. A maximum of 100 names and / or 50 numbers can
be used.
A>MU-PURGE C:MESSAGES /MSG:PIPD45 /EL$Kim Wells$ /NTNFO(H:USERS)
The above command will purge all messages over 45 days old, exclude
any msg with the name KIM WELLS in it from being purged, and then compare
msg SENDER'S, RECEIVERS to those names in the selected user file and delete
the msg(s) if a sender or receiver wasn't found. Additionally, if a
receiver had read their protected mail, that msg will be deleted.
A>MU-PURGE C:USERS /USR:D45 /5 /11 (C:MESSAGES)
The above command will purge the selected users file of anyone who
hasn't logged on in the last 45 days and update checkpoint record in the
file C:MESSAGES's to reflect the new user file totals. Those users who
have a security level of 5 (locked-out) will be retained as well as those
with a security level of 11 or greater (purge exempt). Those values for
your system can be found in CONFIG.EXE parameters numbers #### and ####.
12
A>MU-PURGE C:DAILY.CTL
The above command will load into memory all the commands found in
thecontrol file DAILY.CTL
The Following are examples of the two control files that I use. One is
for daily purging and the second is for monthly purging.
Ex. 1 Daily
H:MESSAGES /MSG:PIP
H:TESTM.DEF /MSG:PIP
H:USERS /USR:D45 LOG /5 /11 (H:MESSAGES)
H:MESSAGES /MSG:D45 LOG PIP /EL$KIM WELLS;SYSOP$ /NTO(H:USERS)
** ALL MU-PURGE commands can be stacked after the first slash when
placed in their proper switch positions.
13
Ex. 2 Monthly
-- APPENDIX C -- Revision Information
Version 3.0 12 Nov 86
1. Program was completely rewritten
2. Features to have certain message(s) excluded from purging were
added. The user can specify a list of names or numbers on the commandline
or from a file or both.
3. Code to purge a user file(s) was added
Version 2.0 8 March 86
1. Program code was rewritten in the general format that RBBS-PC is
written in.
2. Command line switches were added which adds the ability to Pack in
Place any message type file, eliminating the need for extra disk space;
Buffering all read/write operations as this program purges the msg file
with either type purging mode; deleting messages that are to old based on
their age in days; and finally the option of a small opening screen was
added.
Version 1.2 1 December 85
1. Each message header is now checked for a valid message number and
a minimum number of records per message in addition to a valid active /
killed status flag. If any of the above are not present or not in proper
form, the message header and following records are purged until a good
message header is found.
2. A possible bug was fixed which could have over written node
records.
3. Sample DOS and EBL batch files and the counter program in the
main doc file were updated.
4. Program code was made smaller.
Version 1.1 20 October 85
1. First release
Version 1.0 --------------
1. If you've got it........I didn't write it.
Kim Wells
***** End of MU-PURGE Documentation *****
14